// 字符串方法 在严格模式下会报错 -- 最新版本refs已被弃用
import React, { Component } from 'react';
class zfcref extends Component {
  constructor(props) {
    super(props);
    this.state = {}
  }
  render() {
    return (
      <div>
        <div>
          <input type="text" ref="input1" placeholder="a内容"></input> &nbsp;&nbsp;
          <button onClick={this.showData}>获取a</button>  &nbsp;&nbsp;
          <input onBlur={this.showData2} type="text" ref="input2" placeholder="b内容"></input>
        </div>
      </div>
    );
  }
  showData = () => {
    console.log(this.refs.input1.value)
  }
  showData2 = () => {
    console.log(this.refs.input2.value)
  }
}

export default zfcref;